package evs.testactivation;

import java.util.Vector;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import evs.activation.Requestor;
import evs.brp.RemotingErrorException;

public class ProxyA 
		extends Requestor 
		implements InterfaceObjectA {
	
	private Log log = LogFactory.getLog(ProxyA.class);
		
	public Integer getCounter() {
		log.info("Invoking Requestor Method");
		
		Vector<Class>  argumentClazzes = new Vector<Class>();
		Vector<String> argumentNames = new Vector<String>();
		
		Vector<Object> arguments = new Vector<Object>();
		
		try {
			Object object = this.invoke("evs.testactivation.RemoteObjectA", "getCounter", 
					argumentClazzes, argumentNames, arguments, 
					Integer.class);
			
			return (Integer) object;
		} catch (RemotingErrorException exc) {
			log.error(exc);
			return null;
		}

	}
	
	public void increment() {
		log.info("Invoking Requestor Method");
		
		Vector<Class>  argumentClazzes = new Vector<Class>();
		Vector<String> argumentNames = new Vector<String>();
		
		Vector<Object> arguments = new Vector<Object>();
		
		try {
			Object object = this.invoke("evs.testactivation.RemoteObjectA", "increment", 
					argumentClazzes, argumentNames, arguments, 
					String.class);
			
		} catch (RemotingErrorException exc) {
			log.error(exc);
		}
	}	
	
}
